home *** CD-ROM | disk | FTP | other *** search
/ Internet CD 2005 June / MICD_2005_06.iso / Programista / Bb / BrowserBobDev_en.exe / {app} / Help / webhelp.cab / WebHelp.class (.txt) < prev    next >
Encoding:
Java Class File  |  2004-02-23  |  12.8 KB  |  791 lines

  1. import BsscXML.BsscXML;
  2. import XMLConsumer.Consumer;
  3. import XMLConsumer.Project;
  4. import hhapplet.BsscHelpCommandAdapter;
  5. import hhapplet.BsscHelpRedirector;
  6. import hhapplet.ButtonPushEvent;
  7. import hhapplet.ButtonPushEventListener;
  8. import hhapplet.CanvasButton;
  9. import hhapplet.FtsView;
  10. import hhapplet.FtsViewSkin;
  11. import hhapplet.GloViewSkin;
  12. import hhapplet.GlossaryView;
  13. import hhapplet.ImageCache;
  14. import hhapplet.IndexView;
  15. import hhapplet.IndexViewSkin;
  16. import hhapplet.PaneSetting;
  17. import hhapplet.ResourceLib;
  18. import hhapplet.TabButton;
  19. import hhapplet.TabManagerAdaper;
  20. import hhapplet.TabPanel;
  21. import hhapplet.TocView;
  22. import hhapplet.TocViewSkin;
  23. import hhapplet.URLFileHandler;
  24. import java.applet.Applet;
  25. import java.awt.BorderLayout;
  26. import java.awt.CardLayout;
  27. import java.awt.Color;
  28. import java.awt.Component;
  29. import java.awt.Container;
  30. import java.awt.Event;
  31. import java.awt.Graphics;
  32. import java.awt.LayoutManager;
  33. import java.awt.Panel;
  34. import java.awt.Rectangle;
  35. import java.net.URL;
  36. import java.util.Enumeration;
  37. import java.util.Vector;
  38. import netscape.javascript.JSObject;
  39.  
  40. public class WebHelp extends Applet implements ButtonPushEventListener, BsscHelpCommandAdapter, TabManagerAdaper, Runnable {
  41.    private static final String STR_APPLET_ID = "WebHelp Applet Version 5.00.000";
  42.    private static final String STR_COPYRIGHT = "Copyright (c) 1998-2001 eHelp Corporation. All rights reserved.";
  43.    private boolean m_bShowTab = true;
  44.    private String m_strProjectFile = null;
  45.    private TocView m_tocView = null;
  46.    private IndexView m_indexView = null;
  47.    private FtsView m_ftsView = null;
  48.    private GlossaryView m_gloView = null;
  49.    private Panel m_pnlNav = null;
  50.    private TabPanel m_pnlTabs = null;
  51.    private CardLayout m_clLayout = null;
  52.    private TabButton[] m_abtns;
  53.    private CommandBuffer m_commandBuffer;
  54.    private String m_sLangId = "";
  55.    private boolean m_bMustHaveSize = false;
  56.    boolean m_bCanAccessJSObject = false;
  57.    private boolean m_bCanAccessJSObjectChecked = false;
  58.    private Thread m_CommandThread = null;
  59.    private Vector m_vProjects;
  60.    private PaneSetting m_tocPaneSetting;
  61.    private PaneSetting m_idxPaneSetting;
  62.    private PaneSetting m_ftsPaneSetting;
  63.    private PaneSetting m_gloPaneSetting;
  64.    private int m_nFirstPane;
  65.    private static final int m_nMaxPanes = 4;
  66.  
  67.    public void stop() {
  68.       System.out.println("!!!Applet Stop!!!");
  69.       if (System.getProperty("java.vendor").indexOf("Netscape") != -1 && this.CanQueryHeighAndWidthForNS()) {
  70.          try {
  71.             JSObject var1 = JSObject.getWindow(this);
  72.             var1.setMember("gbLoading", "Phase1");
  73.          } catch (Exception var3) {
  74.             ((Throwable)var3).printStackTrace();
  75.          }
  76.       }
  77.  
  78.       try {
  79.          if (this.m_CommandThread != null) {
  80.             new WhCommand("Quit", (String)null, (String)null);
  81.             this.m_CommandThread.stop();
  82.          }
  83.  
  84.          System.gc();
  85.          Runtime.getRuntime().gc();
  86.       } catch (Exception var2) {
  87.          ((Throwable)var2).printStackTrace();
  88.       }
  89.    }
  90.  
  91.    public boolean gotFocus(Event var1, Object var2) {
  92.       ((Component)this).nextFocus();
  93.       return true;
  94.    }
  95.  
  96.    public void notifyButtonPushEvent(ButtonPushEvent var1) {
  97.       if (this.m_tocPaneSetting != null && var1.getSource() == this.m_abtns[this.m_tocPaneSetting.getIndex()]) {
  98.          this.DoContents();
  99.       } else if (this.m_idxPaneSetting != null && var1.getSource() == this.m_abtns[this.m_idxPaneSetting.getIndex()]) {
  100.          this.DoIndex();
  101.       } else if (this.m_ftsPaneSetting != null && var1.getSource() == this.m_abtns[this.m_ftsPaneSetting.getIndex()]) {
  102.          this.DoSearch("");
  103.       } else {
  104.          if (this.m_gloPaneSetting != null && var1.getSource() == this.m_abtns[this.m_gloPaneSetting.getIndex()]) {
  105.             this.DoGlossary();
  106.          }
  107.  
  108.       }
  109.    }
  110.  
  111.    private void activeTabButton(int var1) {
  112.       int var2 = 0;
  113.  
  114.       do {
  115.          if (this.m_abtns[var2] != null) {
  116.             if (var2 != var1) {
  117.                this.m_abtns[var2].disactive();
  118.                if (var2 == var1 - 1) {
  119.                   this.m_abtns[var2].SetDrawRight(false);
  120.                } else {
  121.                   this.m_abtns[var2].SetDrawRight(true);
  122.                }
  123.  
  124.                if (var2 == var1 + 1) {
  125.                   this.m_abtns[var2].SetDrawLeft(false);
  126.                } else {
  127.                   this.m_abtns[var2].SetDrawLeft(true);
  128.                }
  129.             } else {
  130.                this.m_abtns[var2].active();
  131.             }
  132.  
  133.             this.m_abtns[var2].repaint(0L);
  134.          }
  135.  
  136.          ++var2;
  137.       } while(var2 < 4);
  138.  
  139.    }
  140.  
  141.    public boolean CanQueryHeighAndWidthForNS() {
  142.       if (this.m_bCanAccessJSObjectChecked) {
  143.          return this.m_bCanAccessJSObject;
  144.       } else {
  145.          this.m_bCanAccessJSObjectChecked = true;
  146.          return this._checkAccess();
  147.       }
  148.    }
  149.  
  150.    public void start() {
  151.       System.out.println("!!!Applet Start!!!");
  152.  
  153.       try {
  154.          if (this.m_bMustHaveSize) {
  155.             this.checkSize();
  156.          }
  157.  
  158.          this.m_CommandThread = new Thread(this);
  159.          this.m_CommandThread.start();
  160.       } catch (Exception var2) {
  161.          ((Throwable)var2).printStackTrace();
  162.       }
  163.  
  164.       if (System.getProperty("java.vendor").indexOf("Netscape") == -1) {
  165.          this.myrun();
  166.       }
  167.  
  168.    }
  169.  
  170.    public String getAppletInfo() {
  171.       return "WebHelp Applet Version 5.00.000" + "\r\n" + "Copyright (c) 1998-2001 eHelp Corporation. All rights reserved.";
  172.    }
  173.  
  174.    private void DoGlossary() {
  175.       if (this.m_gloPaneSetting != null) {
  176.          this.activeTabButton(this.m_gloPaneSetting.getIndex());
  177.          if (this.m_pnlNav == null) {
  178.             this.m_clLayout = new CardLayout();
  179.             this.m_pnlNav = new Panel();
  180.             this.m_pnlNav.setLayout(this.m_clLayout);
  181.             ((Container)this).add("Center", this.m_pnlNav);
  182.          }
  183.  
  184.          this.m_bMustHaveSize = true;
  185.          if (this.m_gloView == null) {
  186.             GloViewSkin var1 = (GloViewSkin)this.m_gloPaneSetting.getViewSkin();
  187.             this.m_gloView = new GlossaryView(this.m_vProjects, var1);
  188.             this.m_pnlNav.add(ResourceLib.GetRes("Glossary"), this.m_gloView);
  189.             ((Applet)this).showStatus(ResourceLib.GetRes("LoadingGlossary"));
  190.          }
  191.  
  192.          this.m_clLayout.show(this.m_pnlNav, ResourceLib.GetRes("Glossary"));
  193.          ((Component)this).repaint();
  194.          this.RepaintTabs();
  195.          if (this.m_gloView != null) {
  196.             this.m_gloView.requestFocus();
  197.          }
  198.       }
  199.  
  200.    }
  201.  
  202.    public void reshape(int var1, int var2, int var3, int var4) {
  203.       System.out.println("!!!Applet Reshape!!!");
  204.  
  205.       try {
  206.          if (System.getProperty("java.vendor").startsWith("Netscape") && (System.getProperty("os.name").startsWith("Windows") || System.getProperty("os.name").startsWith("Mac"))) {
  207.             if (this.CanQueryHeighAndWidthForNS()) {
  208.                WebHelp$JavaScriptAccess var5 = new WebHelp$JavaScriptAccess(this, this);
  209.                var4 = var5.GetHeight(var4);
  210.                var3 = var5.GetWidth(var3);
  211.                if (!this.m_bShowTab) {
  212.                   try {
  213.                      if (System.getProperty("java.vendor").indexOf("Netscape") != -1) {
  214.                         ((Component)this).getParent().reshape(var1, var2, var3, var4);
  215.                      }
  216.                   } catch (Exception var7) {
  217.                      ((Throwable)var7).printStackTrace();
  218.                   }
  219.                }
  220.  
  221.                super.reshape(var1, var2, var3, var4);
  222.                ((Container)this).validate();
  223.             } else {
  224.                super.reshape(var1, var2, var3, var4);
  225.             }
  226.          } else {
  227.             super.reshape(var1, var2, var3, var4);
  228.             ((Container)this).validate();
  229.          }
  230.       } catch (Exception var8) {
  231.          ((Throwable)var8).printStackTrace();
  232.       }
  233.    }
  234.  
  235.    private void DoNavPane() {
  236.       ((Component)this).setBackground(new Color(192, 192, 192));
  237.       ((Container)this).setLayout(new BorderLayout());
  238.       this.m_strProjectFile = ((Applet)this).getParameter("ProjectFile");
  239.       if (this.m_strProjectFile != null && this.m_strProjectFile.length() > 0) {
  240.          this.loadProject(this.m_strProjectFile);
  241.       }
  242.  
  243.       String var1 = ((Applet)this).getParameter("HideTabs");
  244.       if (var1 != null && var1.toUpperCase().compareTo("TRUE") == 0) {
  245.          this.m_bShowTab = false;
  246.       } else {
  247.          this.m_bShowTab = true;
  248.       }
  249.  
  250.       Object var2 = null;
  251.       String var9 = ((Applet)this).getParameter("ContentsTab");
  252.       if (var9 == null) {
  253.          var9 = ResourceLib.GetRes("Contents");
  254.       }
  255.  
  256.       Object var3 = null;
  257.       String var10 = ((Applet)this).getParameter("IndexTab");
  258.       if (var10 == null) {
  259.          var10 = ResourceLib.GetRes("Index");
  260.       }
  261.  
  262.       Object var4 = null;
  263.       String var11 = ((Applet)this).getParameter("SearchTab");
  264.       if (var11 == null) {
  265.          var11 = ResourceLib.GetRes("Search");
  266.       }
  267.  
  268.       Object var5 = null;
  269.       String var12 = ((Applet)this).getParameter("GlossaryTab");
  270.       if (var12 == null) {
  271.          var12 = ResourceLib.GetRes("Glossary");
  272.       }
  273.  
  274.       this.m_pnlTabs = null;
  275.       this.m_pnlTabs = new TabPanel();
  276.       this.m_pnlTabs.setLayout((LayoutManager)null);
  277.       this.m_abtns = new TabButton[4];
  278.       if (this.m_tocPaneSetting != null) {
  279.          TabButton var6 = new TabButton(var9, this);
  280.          ((CanvasButton)var6).addButtonPushEventListener(this);
  281.          if (4 > this.m_tocPaneSetting.getIndex()) {
  282.             this.m_abtns[this.m_tocPaneSetting.getIndex()] = var6;
  283.          }
  284.       }
  285.  
  286.       if (this.m_idxPaneSetting != null) {
  287.          TabButton var13 = new TabButton(var10, this);
  288.          ((CanvasButton)var13).addButtonPushEventListener(this);
  289.          if (4 > this.m_idxPaneSetting.getIndex()) {
  290.             this.m_abtns[this.m_idxPaneSetting.getIndex()] = var13;
  291.          }
  292.       }
  293.  
  294.       if (this.m_ftsPaneSetting != null) {
  295.          TabButton var14 = new TabButton(var11, this);
  296.          ((CanvasButton)var14).addButtonPushEventListener(this);
  297.          if (4 > this.m_ftsPaneSetting.getIndex()) {
  298.             this.m_abtns[this.m_ftsPaneSetting.getIndex()] = var14;
  299.          }
  300.       }
  301.  
  302.       if (this.m_gloPaneSetting != null) {
  303.          TabButton var15 = new TabButton(var12, this);
  304.          ((CanvasButton)var15).addButtonPushEventListener(this);
  305.          if (4 > this.m_gloPaneSetting.getIndex()) {
  306.             this.m_abtns[this.m_gloPaneSetting.getIndex()] = var15;
  307.          }
  308.       }
  309.  
  310.       int var16 = 0;
  311.  
  312.       do {
  313.          if (this.m_abtns[var16] != null) {
  314.             this.m_pnlTabs.add(this.m_abtns[var16]);
  315.          }
  316.  
  317.          ++var16;
  318.       } while(var16 < 4);
  319.  
  320.       if (this.m_bShowTab) {
  321.          ((Container)this).add("North", this.m_pnlTabs);
  322.       }
  323.  
  324.       Rectangle var17 = ((Component)this).bounds();
  325.       int var7 = 1;
  326.       int var8 = 0;
  327.  
  328.       do {
  329.          if (this.m_abtns[var8] != null) {
  330.             this.rods_reshape(this.m_abtns[var8], var7, var17.y, this.m_abtns[var8].preferredSize().width, 25);
  331.             var7 += this.m_abtns[var8].bounds().width;
  332.          }
  333.  
  334.          ++var8;
  335.       } while(var8 < 4);
  336.  
  337.       this.rods_reshape(this.m_pnlTabs, var17.x, var17.y, var17.width, 28);
  338.       this.m_pnlTabs.requestFocus();
  339.       var8 = 0;
  340.  
  341.       do {
  342.          if (this.m_abtns[var8] != null) {
  343.             this.m_abtns[var8].active();
  344.          }
  345.  
  346.          ++var8;
  347.       } while(var8 < 4);
  348.  
  349.       var8 = 0;
  350.  
  351.       do {
  352.          if (this.m_abtns[var8] != null) {
  353.             this.m_abtns[var8].disactive();
  354.          }
  355.  
  356.          ++var8;
  357.       } while(var8 < 4);
  358.  
  359.       if (this.m_abtns[this.m_nFirstPane] != null) {
  360.          Object var20 = null;
  361.          ButtonPushEvent var21 = new ButtonPushEvent(this.m_abtns[this.m_nFirstPane], 0, 0);
  362.          this.notifyButtonPushEvent(var21);
  363.       }
  364.  
  365.    }
  366.  
  367.    public void Command(String var1, String var2) {
  368.       this.Command(var1, var2, (String)null);
  369.    }
  370.  
  371.    public synchronized void Command(String var1, String var2, String var3) {
  372.       if (this.m_commandBuffer != null) {
  373.          WhCommand var4 = new WhCommand(var1, var2, var3);
  374.          this.m_commandBuffer.putCommand(var4);
  375.       }
  376.  
  377.    }
  378.  
  379.    public void Command(String var1) {
  380.       this.Command(var1, (String)null, (String)null);
  381.    }
  382.  
  383.    public void printVMInfo() {
  384.       try {
  385.          System.out.println(System.getProperty("java.version"));
  386.          System.out.println(System.getProperty("java.vendor"));
  387.          System.out.println(System.getProperty("java.vendor.url"));
  388.          System.out.println(System.getProperty("java.home"));
  389.          System.out.println(System.getProperty("java.class.path"));
  390.          System.out.println(System.getProperty("java.class.version"));
  391.          System.out.println(System.getProperty("os.name"));
  392.          System.out.println(System.getProperty("os.arch"));
  393.          System.out.println(System.getProperty("os.version"));
  394.          System.out.println(System.getProperty("user.name"));
  395.          System.out.println(System.getProperty("user.home"));
  396.          System.out.println(System.getProperty("user.dir"));
  397.       } catch (Exception var2) {
  398.          ((Throwable)var2).printStackTrace();
  399.       }
  400.    }
  401.  
  402.    public void paint(Graphics var1) {
  403.       System.out.println("!!!Applet paint!!!");
  404.       super.paint(var1);
  405.    }
  406.  
  407.    public void destroy() {
  408.       System.out.println("!!!Applet Destroy!!!");
  409.  
  410.       try {
  411.          System.gc();
  412.          Runtime.getRuntime().gc();
  413.       } catch (Exception var2) {
  414.          ((Throwable)var2).printStackTrace();
  415.       }
  416.    }
  417.  
  418.    protected void rods_reshape(Component var1, int var2, int var3, int var4, int var5) {
  419.       var1.move(var2, var3);
  420.       var1.resize(var4, var5);
  421.    }
  422.  
  423.    private void DoContents() {
  424.       if (this.m_tocPaneSetting != null) {
  425.          this.activeTabButton(this.m_tocPaneSetting.getIndex());
  426.          if (this.m_pnlNav == null) {
  427.             this.m_clLayout = new CardLayout();
  428.             this.m_pnlNav = new Panel();
  429.             this.m_pnlNav.setLayout(this.m_clLayout);
  430.             ((Container)this).add("Center", this.m_pnlNav);
  431.          }
  432.  
  433.          this.m_bMustHaveSize = true;
  434.          this.RepaintTabs();
  435.          if (this.m_tocView == null) {
  436.             TocViewSkin var1 = (TocViewSkin)this.m_tocPaneSetting.getViewSkin();
  437.             this.m_tocView = new TocView(this.m_vProjects, var1);
  438.             this.m_pnlNav.add(ResourceLib.GetRes("Contents"), this.m_tocView);
  439.             ((Applet)this).showStatus(ResourceLib.GetRes("LoadingContents"));
  440.          }
  441.  
  442.          this.m_clLayout.show(this.m_pnlNav, ResourceLib.GetRes("Contents"));
  443.          if (this.m_tocView != null) {
  444.             this.m_tocView.requestFocus();
  445.          }
  446.       }
  447.  
  448.    }
  449.  
  450.    public void resize(int var1, int var2) {
  451.       System.out.println("!!!Applet Resize!!!");
  452.       if (System.getProperty("java.vendor").indexOf("Netscape") != -1) {
  453.          if (this.CanQueryHeighAndWidthForNS()) {
  454.             try {
  455.                JSObject var3 = JSObject.getWindow(this);
  456.                var3.setMember("gbLoading", "Phase1");
  457.             } catch (Exception var6) {
  458.                ((Throwable)var6).printStackTrace();
  459.             }
  460.          }
  461.       } else if (System.getProperty("java.vendor").indexOf("Microsoft") != -1 && System.getProperty("java.version").startsWith("1.1")) {
  462.          try {
  463.             JSObject var7 = JSObject.getWindow(this);
  464.             var7.setMember("gbLoading", "Phase1");
  465.          } catch (Exception var5) {
  466.             ((Throwable)var5).printStackTrace();
  467.          }
  468.       }
  469.  
  470.       try {
  471.          if (this.CanQueryHeighAndWidthForNS()) {
  472.             WebHelp$JavaScriptAccess var8 = new WebHelp$JavaScriptAccess(this, this);
  473.             var2 = var8.GetHeight(var2);
  474.             var1 = var8.GetWidth(var1);
  475.          }
  476.  
  477.          super.resize(var1, var2);
  478.       } catch (Exception var4) {
  479.          ((Throwable)var4).printStackTrace();
  480.       }
  481.    }
  482.  
  483.    public synchronized boolean checkSize() {
  484.       if (((Component)this).bounds().width == 0 && ((Component)this).bounds().height == 0) {
  485.          String var1 = ((Applet)this).getDocumentBase().toString();
  486.          int var2 = var1.lastIndexOf(".");
  487.          String var3 = var1.substring(var2, var1.length());
  488.          var1 = var1.substring(0, var2);
  489.          var1 = var1 + "f" + var3;
  490.  
  491.          try {
  492.             URL var4 = new URL(var1);
  493.             ((Applet)this).getAppletContext().showDocument(var4, "_self");
  494.             return false;
  495.          } catch (Exception var5) {
  496.             ((Throwable)var5).printStackTrace();
  497.          }
  498.       }
  499.  
  500.       return true;
  501.    }
  502.  
  503.    private void DoSearch(String var1) {
  504.       if (this.m_ftsPaneSetting != null) {
  505.          this.activeTabButton(this.m_ftsPaneSetting.getIndex());
  506.          if (this.m_pnlNav == null) {
  507.             this.m_clLayout = new CardLayout();
  508.             this.m_pnlNav = new Panel();
  509.             this.m_pnlNav.setLayout(this.m_clLayout);
  510.             ((Container)this).add("Center", this.m_pnlNav);
  511.          }
  512.  
  513.          this.m_bMustHaveSize = true;
  514.          if (this.m_ftsView == null) {
  515.             FtsViewSkin var2 = (FtsViewSkin)this.m_ftsPaneSetting.getViewSkin();
  516.             this.m_ftsView = new FtsView(this.m_vProjects, var2);
  517.             this.m_pnlNav.add(ResourceLib.GetRes("Search"), this.m_ftsView);
  518.             ((Applet)this).showStatus(ResourceLib.GetRes("LoadingFTS"));
  519.          }
  520.  
  521.          if (var1 != null && var1.length() != 0) {
  522.             this.m_ftsView.setSearchString(var1);
  523.          }
  524.  
  525.          this.m_clLayout.show(this.m_pnlNav, ResourceLib.GetRes("Search"));
  526.          ((Component)this).repaint();
  527.          this.RepaintTabs();
  528.          if (this.m_ftsView != null) {
  529.             this.m_ftsView.requestFocus();
  530.          }
  531.       }
  532.  
  533.    }
  534.  
  535.    public void myrun() {
  536.       try {
  537.          System.gc();
  538.          Runtime.getRuntime().gc();
  539.          ImageCache.createInstance(this);
  540.          BsscXML.setDocumentBase(((Applet)this).getDocumentBase());
  541.          ResourceLib.InitRes();
  542.          String var1 = ((Applet)this).getParameter("ResourceFile");
  543.          if (var1 != null) {
  544.             ResourceLib.LoadResource(var1);
  545.          }
  546.  
  547.          this.m_tocPaneSetting = ResourceLib.getPaneSetting("toc");
  548.          this.m_idxPaneSetting = ResourceLib.getPaneSetting("index");
  549.          this.m_ftsPaneSetting = ResourceLib.getPaneSetting("fts");
  550.          this.m_gloPaneSetting = ResourceLib.getPaneSetting("glossary");
  551.          this.m_nFirstPane = ResourceLib.getFirstShowPaneIndex();
  552.          String var2 = ((Applet)this).getParameter("Frame");
  553.          if (var2 == null) {
  554.             var2 = "bsscright";
  555.          }
  556.  
  557.          BsscHelpRedirector.initRedirector(this, var2);
  558.          this.DoNavPane();
  559.          ((Component)this).show();
  560.       } catch (Exception var3) {
  561.          ((Throwable)var3).printStackTrace();
  562.       }
  563.    }
  564.  
  565.    private void RepaintTabs() {
  566.       if (this.m_bShowTab) {
  567.          if (this.m_pnlNav != null) {
  568.             this.m_pnlNav.paintAll(this.m_pnlNav.getGraphics());
  569.          }
  570.  
  571.          int var1 = 0;
  572.  
  573.          do {
  574.             if (this.m_abtns[var1] != null) {
  575.                this.m_abtns[var1].paint(this.m_abtns[var1].getGraphics());
  576.             }
  577.  
  578.             ++var1;
  579.          } while(var1 < 4);
  580.       }
  581.  
  582.    }
  583.  
  584.    private void DoIndex() {
  585.       if (this.m_idxPaneSetting != null) {
  586.          this.activeTabButton(this.m_idxPaneSetting.getIndex());
  587.          if (this.m_pnlNav == null) {
  588.             this.m_clLayout = new CardLayout();
  589.             this.m_pnlNav = new Panel();
  590.             this.m_pnlNav.setLayout(this.m_clLayout);
  591.             ((Container)this).add("Center", this.m_pnlNav);
  592.          }
  593.  
  594.          this.m_bMustHaveSize = true;
  595.          if (this.m_indexView == null) {
  596.             IndexViewSkin var1 = (IndexViewSkin)this.m_idxPaneSetting.getViewSkin();
  597.             this.m_indexView = new IndexView(this.m_vProjects, var1);
  598.             this.m_pnlNav.add(ResourceLib.GetRes("Index"), this.m_indexView);
  599.             ((Applet)this).showStatus(ResourceLib.GetRes("LoadingIndex"));
  600.          }
  601.  
  602.          this.m_clLayout.show(this.m_pnlNav, ResourceLib.GetRes("Index"));
  603.          this.m_pnlNav.paintAll(this.m_pnlNav.getGraphics());
  604.          this.RepaintTabs();
  605.          if (this.m_indexView != null) {
  606.             this.m_indexView.requestFocus();
  607.          }
  608.       }
  609.  
  610.    }
  611.  
  612.    public boolean GoNext(Object var1) {
  613.       if (this.m_pnlTabs == null) {
  614.          return false;
  615.       } else {
  616.          for(int var2 = 0; var2 < this.m_pnlTabs.getComponentCount(); ++var2) {
  617.             if (this.m_pnlTabs.getComponent(var2) == var1) {
  618.                if (var2 != this.m_pnlTabs.getComponentCount() - 1) {
  619.                   Component var3 = this.m_pnlTabs.getComponent(var2 + 1);
  620.                   var3.requestFocus();
  621.                   this.notifyButtonPushEvent(new ButtonPushEvent(var3, 0, 0));
  622.                   return true;
  623.                }
  624.  
  625.                return false;
  626.             }
  627.          }
  628.  
  629.          return false;
  630.       }
  631.    }
  632.  
  633.    private void DoSync(String var1, String var2) {
  634.       if (this.m_tocView != null) {
  635.          this.m_tocView.sync(var1, var2);
  636.       }
  637.  
  638.    }
  639.  
  640.    public void run() {
  641.       while(true) {
  642.          try {
  643.             Object var1 = null;
  644.  
  645.             while((var6 = this.m_commandBuffer.getCommand()) == null) {
  646.                Thread.currentThread();
  647.                Thread.sleep(100L);
  648.             }
  649.  
  650.             String var2 = var6.getName();
  651.             String var3 = var6.getParam0();
  652.             String var4 = var6.getParam1();
  653.             if (var2.equalsIgnoreCase("SyncToc")) {
  654.                this.DoSync(var3, var4);
  655.             } else if (var2.equalsIgnoreCase("Contents")) {
  656.                this.DoContents();
  657.             } else if (var2.equalsIgnoreCase("Index")) {
  658.                this.DoIndex();
  659.             } else if (var2.equalsIgnoreCase("Search")) {
  660.                this.DoSearch(var3);
  661.             } else if (var2.equalsIgnoreCase("Glossary")) {
  662.                this.DoGlossary();
  663.             } else if (var2.equalsIgnoreCase("Quit")) {
  664.                return;
  665.             }
  666.          } catch (Exception var5) {
  667.             ((Throwable)var5).printStackTrace();
  668.          }
  669.       }
  670.    }
  671.  
  672.    public void init() {
  673.       this.m_commandBuffer = new CommandBuffer();
  674.       System.out.println("!!!Applet Init!!!");
  675.       if (System.getProperty("java.vendor").indexOf("Netscape") != -1) {
  676.          this.myrun();
  677.       }
  678.  
  679.    }
  680.  
  681.    public boolean GoPrev(Object var1) {
  682.       if (this.m_pnlTabs == null) {
  683.          return false;
  684.       } else {
  685.          for(int var2 = 0; var2 < this.m_pnlTabs.getComponentCount(); ++var2) {
  686.             if (this.m_pnlTabs.getComponent(var2) == var1) {
  687.                if (var2 != 0) {
  688.                   Component var3 = this.m_pnlTabs.getComponent(var2 - 1);
  689.                   var3.requestFocus();
  690.                   this.notifyButtonPushEvent(new ButtonPushEvent(var3, 0, 0));
  691.                   return true;
  692.                }
  693.  
  694.                return false;
  695.             }
  696.          }
  697.  
  698.          return false;
  699.       }
  700.    }
  701.  
  702.    public synchronized void resizeForNS(int var1, int var2) {
  703.       try {
  704.          if (System.getProperty("java.vendor").indexOf("Netscape") != -1) {
  705.             ((Component)this).getParent().reshape(0, 0, var1, var2);
  706.          }
  707.  
  708.          super.reshape(0, 0, var1, var2);
  709.          ((Container)this).validate();
  710.       } catch (Exception var4) {
  711.          ((Throwable)var4).printStackTrace();
  712.       }
  713.    }
  714.  
  715.    private boolean _checkAccess() {
  716.       if (System.getProperty("java.vendor").startsWith("Netscape") && (System.getProperty("os.name").startsWith("Windows") || System.getProperty("os.name").startsWith("Mac"))) {
  717.          try {
  718.             if (((Applet)this).getParameter("BrowserVersion") == null || !((Applet)this).getParameter("BrowserVersion").equalsIgnoreCase("4.6")) {
  719.                JSObject.getWindow(this);
  720.                this.m_bCanAccessJSObject = true;
  721.             }
  722.          } catch (Exception var2) {
  723.             System.gc();
  724.             ((Throwable)var2).printStackTrace();
  725.          }
  726.       }
  727.  
  728.       return this.m_bCanAccessJSObject;
  729.    }
  730.  
  731.    public void loadProject(String var1) {
  732.       try {
  733.          Project.setFileName(var1);
  734.          this.m_vProjects = new Vector();
  735.          URL var2 = URLFileHandler.makeURL(BsscXML.getDocumentBase(), var1, (String)null);
  736.          this.m_vProjects.addElement(new Project(var2));
  737.          int var3 = 0;
  738.  
  739.          do {
  740.             Project var4 = (Project)this.m_vProjects.elementAt(var3);
  741.  
  742.             try {
  743.                ((Consumer)var4).process();
  744.                if (var3 == 0) {
  745.                   this.m_sLangId = var4.getLangId();
  746.                } else {
  747.                   String var5 = var4.getLangId();
  748.                   if (var5.length() != 0 && !this.m_sLangId.equals(var5)) {
  749.                      System.out.println("The Project:" + ((Consumer)var4).getURL() + "is using a different language to the main project, which will cause the index and full text search functionality to be disabled for this remote project");
  750.                   }
  751.                }
  752.  
  753.                URL var15 = ((Consumer)var4).getURL();
  754.                Vector var6 = var4.getRemoteProject();
  755.                Enumeration var7 = var6.elements();
  756.  
  757.                while(var7.hasMoreElements()) {
  758.                   Object var8 = var7.nextElement();
  759.                   if (var8 instanceof String) {
  760.                      URL var9 = URLFileHandler.makeURL(var15, (String)var8 + var1, (String)null);
  761.                      boolean var10 = false;
  762.                      Enumeration var11 = this.m_vProjects.elements();
  763.  
  764.                      while(var11.hasMoreElements()) {
  765.                         Object var12 = var11.nextElement();
  766.                         if (var12 instanceof Project && ((Project)var12).getURL().equals(var9)) {
  767.                            var10 = true;
  768.                            break;
  769.                         }
  770.                      }
  771.  
  772.                      if (!var10) {
  773.                         this.m_vProjects.addElement(new Project(var9));
  774.                      }
  775.                   }
  776.                }
  777.  
  778.                ++var3;
  779.             } catch (Exception var13) {
  780.                this.m_vProjects.removeElementAt(var3);
  781.                ((Throwable)var13).printStackTrace();
  782.             }
  783.          } while(var3 < this.m_vProjects.size());
  784.  
  785.          System.out.println("Well done!");
  786.       } catch (Exception var14) {
  787.          ((Throwable)var14).printStackTrace();
  788.       }
  789.    }
  790. }
  791.